package com.xunyin.modules.weixin.service;

import com.alibaba.fastjson.JSONObject;
import com.xunyin.modules.mtorder.domain.MtOrder;
import com.xunyin.modules.user.domain.YxUser;
import com.xunyin.modules.user.service.dto.UserOrderDto;
import com.xunyin.web.ResponseObject;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;

/**
 * 微信相关业务接口
 * <p>
 * Created by xunyinyunshang <3594419785@qq.com>
 * CopyRight 讯音云商 https://www.tonetn.com
 */
public interface WeixinService {

/*    String getAccessToken(boolean useCache);

    ResponseObject createPrepayOrder(SysXbuser userInfo, MtOrder orderInfo, Integer payAmount, String authCode, Integer giveAmount, String ip);

    boolean paymentCallback(UserOrderDto orderInfo) ;

    Map<String,String> processResXml(HttpServletRequest request);

    void processRespXml(HttpServletResponse response, boolean flag);

    JSONObject getWxProfile(String code);

    String getPhoneNumber(String encryptedData, String sessionKey, String iv);

    boolean sendSubscribeMessage(Integer userId, String toUserOpenId, String key, String page, Map<String,Object> params, Date sendTime);

    boolean doSendSubscribeMessage(String reqDataJsonStr);*/

    String getAccessToken(boolean useCache);

    ResponseObject createPrepayOrder(YxUser userInfo, MtOrder orderInfo, Integer payAmount, String authCode, Integer giveAmount, String ip, String platform);

    Boolean paymentCallback(UserOrderDto orderInfo);

    Map<String, String> processResXml(HttpServletRequest request);

    void processRespXml(HttpServletResponse response, boolean flag);

    JSONObject getWxProfile(String code);

    JSONObject getWxOpenId(String code);

    String getPhoneNumber(String encryptedData, String session_key, String iv);

    Boolean sendSubscribeMessage(Integer userId, String toUserOpenId, String key, String page, Map<String, Object> params, Date sendTime);

    Boolean doSendSubscribeMessage(String reqDataJsonStr);

    Map<String, String> queryPaidOrder(Integer storeId, String transactionId, String orderSn);

    Boolean doRefund(Integer storeId, String orderSn, BigDecimal totalAmount, BigDecimal refundAmount, String platform);
}